﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace McHighwayHollowPierUi.Model
{
    /// <summary>
    /// 转角类型
    /// </summary>
    public enum CornerType
    {
        /// <summary>
        /// 直角
        /// </summary>
        Right,

        /// <summary>
        /// 圆角
        /// </summary>
        Cicle,

        /// <summary>
        /// 倒角
        /// </summary>
        Chamfer,
    };

    /// <summary>
    /// 转角数据
    /// </summary>
    public class CornerData : INotifyPropertyChanged
    {
        private CornerType _type;

        /// <summary>
        /// 转角类型
        /// </summary>
        public CornerType Type
        {
            get { return _type; }
            set 
            {
                _type = value;
                OnPropertyChanged("Type");
            }
        }


        /// <summary>
        /// 圆角半径
        /// </summary>
        public double Radius { get; set; }

        /// <summary>
        /// 倒角长度
        /// </summary>
        public double Length { get; set; }

        /// <summary>
        /// 倒角高度
        /// </summary>
        public double Height { get; set; }


        /// <summary>
        /// 圆角相关控件是否显示
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public bool CicleVisible
        {
            get
            {
                return Type == CornerType.Cicle;
            } 
        }

        /// <summary>
        /// 倒角相关控件是否显示
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public bool ChamferVisible
        {
            get
            {
                return Type == CornerType.Chamfer;
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)  //属性变更通知
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }
    public class McHighwayHollowPierData
    {
        /// <summary>
        /// 墩柱高度
        /// </summary>
        public double Height { get; set; }

        /// <summary>
        /// 墩柱横截面长边
        /// </summary>
        public double Length { get; set; }

        /// <summary>
        /// 墩柱横截面宽边
        /// </summary>
        public double Width { get; set; }

        /// <summary>
        /// 墩柱外转角形式
        /// </summary>
        public CornerData PierCorner { get; set; }

        /// <summary>
        /// 墩柱内转角形式
        /// </summary>
        public CornerData HollowCorner { get; set; }

        /// <summary>
        /// 墩柱壁厚
        /// </summary>
        public double Thickness { get; set; }

        /// <summary>
        /// 墩柱渐变段宽度
        /// </summary>
        public double GradientWidth { get; set; }

        /// <summary>
        /// 墩柱渐变段高度
        /// </summary>
        public double GradientHeight { get; set; }

        /// <summary>
        /// 墩柱顶实心段高度
        /// </summary>
        public double TopSolidHeight { get; set; }

        /// <summary>
        /// 墩柱底实心段高度
        /// </summary>
        public double BottomSolidHeight { get; set; }

    }
}
